/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/minimal");

// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

$root.pb = (function() {

    /**
     * Namespace pb.
     * @exports pb
     * @namespace
     */
    var pb = {};

    pb.Block = (function() {

        /**
         * Properties of a Block.
         * @memberof pb
         * @interface IBlock
         * @property {number|null} [id] Block id
         * @property {pb.Block.Type|null} [type] Block type
         * @property {number|null} [x] Block x
         * @property {number|null} [y] Block y
         * @property {pb.IImages|null} [images] Block images
         * @property {pb.IWeb|null} [web] Block web
         */

        /**
         * Constructs a new Block.
         * @memberof pb
         * @classdesc Represents a Block.
         * @implements IBlock
         * @constructor
         * @param {pb.IBlock=} [properties] Properties to set
         */
        function Block(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Block id.
         * @member {number} id
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.id = 0;

        /**
         * Block type.
         * @member {pb.Block.Type} type
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.type = 0;

        /**
         * Block x.
         * @member {number} x
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.x = 0;

        /**
         * Block y.
         * @member {number} y
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.y = 0;

        /**
         * Block images.
         * @member {pb.IImages|null|undefined} images
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.images = null;

        /**
         * Block web.
         * @member {pb.IWeb|null|undefined} web
         * @memberof pb.Block
         * @instance
         */
        Block.prototype.web = null;

        /**
         * Creates a new Block instance using the specified properties.
         * @function create
         * @memberof pb.Block
         * @static
         * @param {pb.IBlock=} [properties] Properties to set
         * @returns {pb.Block} Block instance
         */
        Block.create = function create(properties) {
            return new Block(properties);
        };

        /**
         * Encodes the specified Block message. Does not implicitly {@link pb.Block.verify|verify} messages.
         * @function encode
         * @memberof pb.Block
         * @static
         * @param {pb.IBlock} message Block message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Block.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
            if (message.x != null && Object.hasOwnProperty.call(message, "x"))
                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.x);
            if (message.y != null && Object.hasOwnProperty.call(message, "y"))
                writer.uint32(/* id 12, wireType 0 =*/96).int32(message.y);
            if (message.images != null && Object.hasOwnProperty.call(message, "images"))
                $root.pb.Images.encode(message.images, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
            if (message.web != null && Object.hasOwnProperty.call(message, "web"))
                $root.pb.Web.encode(message.web, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Block message, length delimited. Does not implicitly {@link pb.Block.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Block
         * @static
         * @param {pb.IBlock} message Block message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Block.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Block message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Block
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Block} Block
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Block.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Block();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.type = reader.int32();
                    break;
                case 11:
                    message.x = reader.int32();
                    break;
                case 12:
                    message.y = reader.int32();
                    break;
                case 20:
                    message.images = $root.pb.Images.decode(reader, reader.uint32());
                    break;
                case 21:
                    message.web = $root.pb.Web.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Block message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Block
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Block} Block
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Block.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Block message.
         * @function verify
         * @memberof pb.Block
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Block.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                    break;
                }
            if (message.x != null && message.hasOwnProperty("x"))
                if (!$util.isInteger(message.x))
                    return "x: integer expected";
            if (message.y != null && message.hasOwnProperty("y"))
                if (!$util.isInteger(message.y))
                    return "y: integer expected";
            if (message.images != null && message.hasOwnProperty("images")) {
                var error = $root.pb.Images.verify(message.images);
                if (error)
                    return "images." + error;
            }
            if (message.web != null && message.hasOwnProperty("web")) {
                var error = $root.pb.Web.verify(message.web);
                if (error)
                    return "web." + error;
            }
            return null;
        };

        /**
         * Creates a Block message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Block
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Block} Block
         */
        Block.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Block)
                return object;
            var message = new $root.pb.Block();
            if (object.id != null)
                message.id = object.id | 0;
            switch (object.type) {
            case "IMAGES":
            case 0:
                message.type = 0;
                break;
            case "WEB":
            case 1:
                message.type = 1;
                break;
            }
            if (object.x != null)
                message.x = object.x | 0;
            if (object.y != null)
                message.y = object.y | 0;
            if (object.images != null) {
                if (typeof object.images !== "object")
                    throw TypeError(".pb.Block.images: object expected");
                message.images = $root.pb.Images.fromObject(object.images);
            }
            if (object.web != null) {
                if (typeof object.web !== "object")
                    throw TypeError(".pb.Block.web: object expected");
                message.web = $root.pb.Web.fromObject(object.web);
            }
            return message;
        };

        /**
         * Creates a plain object from a Block message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Block
         * @static
         * @param {pb.Block} message Block
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Block.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.id = 0;
                object.type = options.enums === String ? "IMAGES" : 0;
                object.x = 0;
                object.y = 0;
                object.images = null;
                object.web = null;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.pb.Block.Type[message.type] : message.type;
            if (message.x != null && message.hasOwnProperty("x"))
                object.x = message.x;
            if (message.y != null && message.hasOwnProperty("y"))
                object.y = message.y;
            if (message.images != null && message.hasOwnProperty("images"))
                object.images = $root.pb.Images.toObject(message.images, options);
            if (message.web != null && message.hasOwnProperty("web"))
                object.web = $root.pb.Web.toObject(message.web, options);
            return object;
        };

        /**
         * Converts this Block to JSON.
         * @function toJSON
         * @memberof pb.Block
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Block.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Type enum.
         * @name pb.Block.Type
         * @enum {number}
         * @property {number} IMAGES=0 IMAGES value
         * @property {number} WEB=1 WEB value
         */
        Block.Type = (function() {
            var valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "IMAGES"] = 0;
            values[valuesById[1] = "WEB"] = 1;
            return values;
        })();

        return Block;
    })();

    pb.Display = (function() {

        /**
         * Properties of a Display.
         * @memberof pb
         * @interface IDisplay
         * @property {number|null} [id] Display id
         * @property {number|null} [backgroundColor] Display backgroundColor
         * @property {string|null} [backgroundUrl] Display backgroundUrl
         * @property {Array.<pb.IPage>|null} [pages] Display pages
         */

        /**
         * Constructs a new Display.
         * @memberof pb
         * @classdesc Represents a Display.
         * @implements IDisplay
         * @constructor
         * @param {pb.IDisplay=} [properties] Properties to set
         */
        function Display(properties) {
            this.pages = [];
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Display id.
         * @member {number} id
         * @memberof pb.Display
         * @instance
         */
        Display.prototype.id = 0;

        /**
         * Display backgroundColor.
         * @member {number} backgroundColor
         * @memberof pb.Display
         * @instance
         */
        Display.prototype.backgroundColor = 0;

        /**
         * Display backgroundUrl.
         * @member {string} backgroundUrl
         * @memberof pb.Display
         * @instance
         */
        Display.prototype.backgroundUrl = "";

        /**
         * Display pages.
         * @member {Array.<pb.IPage>} pages
         * @memberof pb.Display
         * @instance
         */
        Display.prototype.pages = $util.emptyArray;

        /**
         * Creates a new Display instance using the specified properties.
         * @function create
         * @memberof pb.Display
         * @static
         * @param {pb.IDisplay=} [properties] Properties to set
         * @returns {pb.Display} Display instance
         */
        Display.create = function create(properties) {
            return new Display(properties);
        };

        /**
         * Encodes the specified Display message. Does not implicitly {@link pb.Display.verify|verify} messages.
         * @function encode
         * @memberof pb.Display
         * @static
         * @param {pb.IDisplay} message Display message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Display.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.backgroundColor != null && Object.hasOwnProperty.call(message, "backgroundColor"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.backgroundColor);
            if (message.backgroundUrl != null && Object.hasOwnProperty.call(message, "backgroundUrl"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.backgroundUrl);
            if (message.pages != null && message.pages.length)
                for (var i = 0; i < message.pages.length; ++i)
                    $root.pb.Page.encode(message.pages[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Display message, length delimited. Does not implicitly {@link pb.Display.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Display
         * @static
         * @param {pb.IDisplay} message Display message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Display.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Display message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Display
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Display} Display
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Display.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Display();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.backgroundColor = reader.int32();
                    break;
                case 3:
                    message.backgroundUrl = reader.string();
                    break;
                case 4:
                    if (!(message.pages && message.pages.length))
                        message.pages = [];
                    message.pages.push($root.pb.Page.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Display message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Display
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Display} Display
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Display.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Display message.
         * @function verify
         * @memberof pb.Display
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Display.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor"))
                if (!$util.isInteger(message.backgroundColor))
                    return "backgroundColor: integer expected";
            if (message.backgroundUrl != null && message.hasOwnProperty("backgroundUrl"))
                if (!$util.isString(message.backgroundUrl))
                    return "backgroundUrl: string expected";
            if (message.pages != null && message.hasOwnProperty("pages")) {
                if (!Array.isArray(message.pages))
                    return "pages: array expected";
                for (var i = 0; i < message.pages.length; ++i) {
                    var error = $root.pb.Page.verify(message.pages[i]);
                    if (error)
                        return "pages." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Display message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Display
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Display} Display
         */
        Display.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Display)
                return object;
            var message = new $root.pb.Display();
            if (object.id != null)
                message.id = object.id | 0;
            if (object.backgroundColor != null)
                message.backgroundColor = object.backgroundColor | 0;
            if (object.backgroundUrl != null)
                message.backgroundUrl = String(object.backgroundUrl);
            if (object.pages) {
                if (!Array.isArray(object.pages))
                    throw TypeError(".pb.Display.pages: array expected");
                message.pages = [];
                for (var i = 0; i < object.pages.length; ++i) {
                    if (typeof object.pages[i] !== "object")
                        throw TypeError(".pb.Display.pages: object expected");
                    message.pages[i] = $root.pb.Page.fromObject(object.pages[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Display message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Display
         * @static
         * @param {pb.Display} message Display
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Display.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.arrays || options.defaults)
                object.pages = [];
            if (options.defaults) {
                object.id = 0;
                object.backgroundColor = 0;
                object.backgroundUrl = "";
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.backgroundColor != null && message.hasOwnProperty("backgroundColor"))
                object.backgroundColor = message.backgroundColor;
            if (message.backgroundUrl != null && message.hasOwnProperty("backgroundUrl"))
                object.backgroundUrl = message.backgroundUrl;
            if (message.pages && message.pages.length) {
                object.pages = [];
                for (var j = 0; j < message.pages.length; ++j)
                    object.pages[j] = $root.pb.Page.toObject(message.pages[j], options);
            }
            return object;
        };

        /**
         * Converts this Display to JSON.
         * @function toJSON
         * @memberof pb.Display
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Display.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Display;
    })();

    pb.Images = (function() {

        /**
         * Properties of an Images.
         * @memberof pb
         * @interface IImages
         * @property {number|null} [id] Images id
         * @property {number|null} [time] Images time
         * @property {Array.<string>|null} [urls] Images urls
         * @property {number|null} [width] Images width
         * @property {number|null} [height] Images height
         */

        /**
         * Constructs a new Images.
         * @memberof pb
         * @classdesc Represents an Images.
         * @implements IImages
         * @constructor
         * @param {pb.IImages=} [properties] Properties to set
         */
        function Images(properties) {
            this.urls = [];
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Images id.
         * @member {number} id
         * @memberof pb.Images
         * @instance
         */
        Images.prototype.id = 0;

        /**
         * Images time.
         * @member {number} time
         * @memberof pb.Images
         * @instance
         */
        Images.prototype.time = 0;

        /**
         * Images urls.
         * @member {Array.<string>} urls
         * @memberof pb.Images
         * @instance
         */
        Images.prototype.urls = $util.emptyArray;

        /**
         * Images width.
         * @member {number} width
         * @memberof pb.Images
         * @instance
         */
        Images.prototype.width = 0;

        /**
         * Images height.
         * @member {number} height
         * @memberof pb.Images
         * @instance
         */
        Images.prototype.height = 0;

        /**
         * Creates a new Images instance using the specified properties.
         * @function create
         * @memberof pb.Images
         * @static
         * @param {pb.IImages=} [properties] Properties to set
         * @returns {pb.Images} Images instance
         */
        Images.create = function create(properties) {
            return new Images(properties);
        };

        /**
         * Encodes the specified Images message. Does not implicitly {@link pb.Images.verify|verify} messages.
         * @function encode
         * @memberof pb.Images
         * @static
         * @param {pb.IImages} message Images message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Images.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.time != null && Object.hasOwnProperty.call(message, "time"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.time);
            if (message.urls != null && message.urls.length)
                for (var i = 0; i < message.urls.length; ++i)
                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.urls[i]);
            if (message.width != null && Object.hasOwnProperty.call(message, "width"))
                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.width);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.height);
            return writer;
        };

        /**
         * Encodes the specified Images message, length delimited. Does not implicitly {@link pb.Images.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Images
         * @static
         * @param {pb.IImages} message Images message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Images.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Images message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Images
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Images} Images
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Images.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Images();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.time = reader.int32();
                    break;
                case 3:
                    if (!(message.urls && message.urls.length))
                        message.urls = [];
                    message.urls.push(reader.string());
                    break;
                case 13:
                    message.width = reader.int32();
                    break;
                case 14:
                    message.height = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Images message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Images
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Images} Images
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Images.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Images message.
         * @function verify
         * @memberof pb.Images
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Images.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.time != null && message.hasOwnProperty("time"))
                if (!$util.isInteger(message.time))
                    return "time: integer expected";
            if (message.urls != null && message.hasOwnProperty("urls")) {
                if (!Array.isArray(message.urls))
                    return "urls: array expected";
                for (var i = 0; i < message.urls.length; ++i)
                    if (!$util.isString(message.urls[i]))
                        return "urls: string[] expected";
            }
            if (message.width != null && message.hasOwnProperty("width"))
                if (!$util.isInteger(message.width))
                    return "width: integer expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            return null;
        };

        /**
         * Creates an Images message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Images
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Images} Images
         */
        Images.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Images)
                return object;
            var message = new $root.pb.Images();
            if (object.id != null)
                message.id = object.id | 0;
            if (object.time != null)
                message.time = object.time | 0;
            if (object.urls) {
                if (!Array.isArray(object.urls))
                    throw TypeError(".pb.Images.urls: array expected");
                message.urls = [];
                for (var i = 0; i < object.urls.length; ++i)
                    message.urls[i] = String(object.urls[i]);
            }
            if (object.width != null)
                message.width = object.width | 0;
            if (object.height != null)
                message.height = object.height | 0;
            return message;
        };

        /**
         * Creates a plain object from an Images message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Images
         * @static
         * @param {pb.Images} message Images
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Images.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.arrays || options.defaults)
                object.urls = [];
            if (options.defaults) {
                object.id = 0;
                object.time = 0;
                object.width = 0;
                object.height = 0;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.time != null && message.hasOwnProperty("time"))
                object.time = message.time;
            if (message.urls && message.urls.length) {
                object.urls = [];
                for (var j = 0; j < message.urls.length; ++j)
                    object.urls[j] = message.urls[j];
            }
            if (message.width != null && message.hasOwnProperty("width"))
                object.width = message.width;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            return object;
        };

        /**
         * Converts this Images to JSON.
         * @function toJSON
         * @memberof pb.Images
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Images.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Images;
    })();

    pb.Msg = (function() {

        /**
         * Properties of a Msg.
         * @memberof pb
         * @interface IMsg
         * @property {number|null} [code] Msg code
         * @property {number|null} [id] Msg id
         * @property {string|null} [error] Msg error
         * @property {pb.IDisplay|null} [display] Msg display
         * @property {pb.IPage|null} [page] Msg page
         * @property {pb.IBlock|null} [block] Msg block
         * @property {pb.IImages|null} [images] Msg images
         * @property {pb.IWeb|null} [web] Msg web
         */

        /**
         * Constructs a new Msg.
         * @memberof pb
         * @classdesc Represents a Msg.
         * @implements IMsg
         * @constructor
         * @param {pb.IMsg=} [properties] Properties to set
         */
        function Msg(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Msg code.
         * @member {number} code
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.code = 0;

        /**
         * Msg id.
         * @member {number} id
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.id = 0;

        /**
         * Msg error.
         * @member {string} error
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.error = "";

        /**
         * Msg display.
         * @member {pb.IDisplay|null|undefined} display
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.display = null;

        /**
         * Msg page.
         * @member {pb.IPage|null|undefined} page
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.page = null;

        /**
         * Msg block.
         * @member {pb.IBlock|null|undefined} block
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.block = null;

        /**
         * Msg images.
         * @member {pb.IImages|null|undefined} images
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.images = null;

        /**
         * Msg web.
         * @member {pb.IWeb|null|undefined} web
         * @memberof pb.Msg
         * @instance
         */
        Msg.prototype.web = null;

        /**
         * Creates a new Msg instance using the specified properties.
         * @function create
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg=} [properties] Properties to set
         * @returns {pb.Msg} Msg instance
         */
        Msg.create = function create(properties) {
            return new Msg(properties);
        };

        /**
         * Encodes the specified Msg message. Does not implicitly {@link pb.Msg.verify|verify} messages.
         * @function encode
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg} message Msg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Msg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.code != null && Object.hasOwnProperty.call(message, "code"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.id);
            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                writer.uint32(/* id 10, wireType 2 =*/82).string(message.error);
            if (message.display != null && Object.hasOwnProperty.call(message, "display"))
                $root.pb.Display.encode(message.display, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim();
            if (message.page != null && Object.hasOwnProperty.call(message, "page"))
                $root.pb.Page.encode(message.page, writer.uint32(/* id 200, wireType 2 =*/1602).fork()).ldelim();
            if (message.block != null && Object.hasOwnProperty.call(message, "block"))
                $root.pb.Block.encode(message.block, writer.uint32(/* id 300, wireType 2 =*/2402).fork()).ldelim();
            if (message.images != null && Object.hasOwnProperty.call(message, "images"))
                $root.pb.Images.encode(message.images, writer.uint32(/* id 400, wireType 2 =*/3202).fork()).ldelim();
            if (message.web != null && Object.hasOwnProperty.call(message, "web"))
                $root.pb.Web.encode(message.web, writer.uint32(/* id 500, wireType 2 =*/4002).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Msg message, length delimited. Does not implicitly {@link pb.Msg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Msg
         * @static
         * @param {pb.IMsg} message Msg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Msg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Msg message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Msg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Msg} Msg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Msg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Msg();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.code = reader.int32();
                    break;
                case 2:
                    message.id = reader.int32();
                    break;
                case 10:
                    message.error = reader.string();
                    break;
                case 100:
                    message.display = $root.pb.Display.decode(reader, reader.uint32());
                    break;
                case 200:
                    message.page = $root.pb.Page.decode(reader, reader.uint32());
                    break;
                case 300:
                    message.block = $root.pb.Block.decode(reader, reader.uint32());
                    break;
                case 400:
                    message.images = $root.pb.Images.decode(reader, reader.uint32());
                    break;
                case 500:
                    message.web = $root.pb.Web.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Msg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Msg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Msg} Msg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Msg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Msg message.
         * @function verify
         * @memberof pb.Msg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Msg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.code != null && message.hasOwnProperty("code"))
                if (!$util.isInteger(message.code))
                    return "code: integer expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.error != null && message.hasOwnProperty("error"))
                if (!$util.isString(message.error))
                    return "error: string expected";
            if (message.display != null && message.hasOwnProperty("display")) {
                var error = $root.pb.Display.verify(message.display);
                if (error)
                    return "display." + error;
            }
            if (message.page != null && message.hasOwnProperty("page")) {
                var error = $root.pb.Page.verify(message.page);
                if (error)
                    return "page." + error;
            }
            if (message.block != null && message.hasOwnProperty("block")) {
                var error = $root.pb.Block.verify(message.block);
                if (error)
                    return "block." + error;
            }
            if (message.images != null && message.hasOwnProperty("images")) {
                var error = $root.pb.Images.verify(message.images);
                if (error)
                    return "images." + error;
            }
            if (message.web != null && message.hasOwnProperty("web")) {
                var error = $root.pb.Web.verify(message.web);
                if (error)
                    return "web." + error;
            }
            return null;
        };

        /**
         * Creates a Msg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Msg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Msg} Msg
         */
        Msg.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Msg)
                return object;
            var message = new $root.pb.Msg();
            if (object.code != null)
                message.code = object.code | 0;
            if (object.id != null)
                message.id = object.id | 0;
            if (object.error != null)
                message.error = String(object.error);
            if (object.display != null) {
                if (typeof object.display !== "object")
                    throw TypeError(".pb.Msg.display: object expected");
                message.display = $root.pb.Display.fromObject(object.display);
            }
            if (object.page != null) {
                if (typeof object.page !== "object")
                    throw TypeError(".pb.Msg.page: object expected");
                message.page = $root.pb.Page.fromObject(object.page);
            }
            if (object.block != null) {
                if (typeof object.block !== "object")
                    throw TypeError(".pb.Msg.block: object expected");
                message.block = $root.pb.Block.fromObject(object.block);
            }
            if (object.images != null) {
                if (typeof object.images !== "object")
                    throw TypeError(".pb.Msg.images: object expected");
                message.images = $root.pb.Images.fromObject(object.images);
            }
            if (object.web != null) {
                if (typeof object.web !== "object")
                    throw TypeError(".pb.Msg.web: object expected");
                message.web = $root.pb.Web.fromObject(object.web);
            }
            return message;
        };

        /**
         * Creates a plain object from a Msg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Msg
         * @static
         * @param {pb.Msg} message Msg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Msg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.code = 0;
                object.id = 0;
                object.error = "";
                object.display = null;
                object.page = null;
                object.block = null;
                object.images = null;
                object.web = null;
            }
            if (message.code != null && message.hasOwnProperty("code"))
                object.code = message.code;
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.error != null && message.hasOwnProperty("error"))
                object.error = message.error;
            if (message.display != null && message.hasOwnProperty("display"))
                object.display = $root.pb.Display.toObject(message.display, options);
            if (message.page != null && message.hasOwnProperty("page"))
                object.page = $root.pb.Page.toObject(message.page, options);
            if (message.block != null && message.hasOwnProperty("block"))
                object.block = $root.pb.Block.toObject(message.block, options);
            if (message.images != null && message.hasOwnProperty("images"))
                object.images = $root.pb.Images.toObject(message.images, options);
            if (message.web != null && message.hasOwnProperty("web"))
                object.web = $root.pb.Web.toObject(message.web, options);
            return object;
        };

        /**
         * Converts this Msg to JSON.
         * @function toJSON
         * @memberof pb.Msg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Msg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Msg;
    })();

    pb.Page = (function() {

        /**
         * Properties of a Page.
         * @memberof pb
         * @interface IPage
         * @property {number|null} [id] Page id
         * @property {number|null} [time] Page time
         * @property {string|null} [backgroundUrl] Page backgroundUrl
         * @property {Array.<pb.IBlock>|null} [blocks] Page blocks
         */

        /**
         * Constructs a new Page.
         * @memberof pb
         * @classdesc Represents a Page.
         * @implements IPage
         * @constructor
         * @param {pb.IPage=} [properties] Properties to set
         */
        function Page(properties) {
            this.blocks = [];
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Page id.
         * @member {number} id
         * @memberof pb.Page
         * @instance
         */
        Page.prototype.id = 0;

        /**
         * Page time.
         * @member {number} time
         * @memberof pb.Page
         * @instance
         */
        Page.prototype.time = 0;

        /**
         * Page backgroundUrl.
         * @member {string} backgroundUrl
         * @memberof pb.Page
         * @instance
         */
        Page.prototype.backgroundUrl = "";

        /**
         * Page blocks.
         * @member {Array.<pb.IBlock>} blocks
         * @memberof pb.Page
         * @instance
         */
        Page.prototype.blocks = $util.emptyArray;

        /**
         * Creates a new Page instance using the specified properties.
         * @function create
         * @memberof pb.Page
         * @static
         * @param {pb.IPage=} [properties] Properties to set
         * @returns {pb.Page} Page instance
         */
        Page.create = function create(properties) {
            return new Page(properties);
        };

        /**
         * Encodes the specified Page message. Does not implicitly {@link pb.Page.verify|verify} messages.
         * @function encode
         * @memberof pb.Page
         * @static
         * @param {pb.IPage} message Page message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Page.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.time != null && Object.hasOwnProperty.call(message, "time"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.time);
            if (message.backgroundUrl != null && Object.hasOwnProperty.call(message, "backgroundUrl"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.backgroundUrl);
            if (message.blocks != null && message.blocks.length)
                for (var i = 0; i < message.blocks.length; ++i)
                    $root.pb.Block.encode(message.blocks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Page message, length delimited. Does not implicitly {@link pb.Page.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Page
         * @static
         * @param {pb.IPage} message Page message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Page.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Page message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Page
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Page} Page
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Page.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Page();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.time = reader.int32();
                    break;
                case 3:
                    message.backgroundUrl = reader.string();
                    break;
                case 4:
                    if (!(message.blocks && message.blocks.length))
                        message.blocks = [];
                    message.blocks.push($root.pb.Block.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Page message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Page
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Page} Page
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Page.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Page message.
         * @function verify
         * @memberof pb.Page
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Page.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.time != null && message.hasOwnProperty("time"))
                if (!$util.isInteger(message.time))
                    return "time: integer expected";
            if (message.backgroundUrl != null && message.hasOwnProperty("backgroundUrl"))
                if (!$util.isString(message.backgroundUrl))
                    return "backgroundUrl: string expected";
            if (message.blocks != null && message.hasOwnProperty("blocks")) {
                if (!Array.isArray(message.blocks))
                    return "blocks: array expected";
                for (var i = 0; i < message.blocks.length; ++i) {
                    var error = $root.pb.Block.verify(message.blocks[i]);
                    if (error)
                        return "blocks." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Page message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Page
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Page} Page
         */
        Page.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Page)
                return object;
            var message = new $root.pb.Page();
            if (object.id != null)
                message.id = object.id | 0;
            if (object.time != null)
                message.time = object.time | 0;
            if (object.backgroundUrl != null)
                message.backgroundUrl = String(object.backgroundUrl);
            if (object.blocks) {
                if (!Array.isArray(object.blocks))
                    throw TypeError(".pb.Page.blocks: array expected");
                message.blocks = [];
                for (var i = 0; i < object.blocks.length; ++i) {
                    if (typeof object.blocks[i] !== "object")
                        throw TypeError(".pb.Page.blocks: object expected");
                    message.blocks[i] = $root.pb.Block.fromObject(object.blocks[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Page message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Page
         * @static
         * @param {pb.Page} message Page
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Page.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.arrays || options.defaults)
                object.blocks = [];
            if (options.defaults) {
                object.id = 0;
                object.time = 0;
                object.backgroundUrl = "";
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.time != null && message.hasOwnProperty("time"))
                object.time = message.time;
            if (message.backgroundUrl != null && message.hasOwnProperty("backgroundUrl"))
                object.backgroundUrl = message.backgroundUrl;
            if (message.blocks && message.blocks.length) {
                object.blocks = [];
                for (var j = 0; j < message.blocks.length; ++j)
                    object.blocks[j] = $root.pb.Block.toObject(message.blocks[j], options);
            }
            return object;
        };

        /**
         * Converts this Page to JSON.
         * @function toJSON
         * @memberof pb.Page
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Page.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Page;
    })();

    pb.Resource = (function() {

        /**
         * Properties of a Resource.
         * @memberof pb
         * @interface IResource
         * @property {number|null} [id] Resource id
         * @property {pb.Resource.Type|null} [type] Resource type
         * @property {string|null} [title] Resource title
         * @property {string|null} [note] Resource note
         * @property {string|null} [url] Resource url
         * @property {string|null} [selector] Resource selector
         */

        /**
         * Constructs a new Resource.
         * @memberof pb
         * @classdesc Represents a Resource.
         * @implements IResource
         * @constructor
         * @param {pb.IResource=} [properties] Properties to set
         */
        function Resource(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Resource id.
         * @member {number} id
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.id = 0;

        /**
         * Resource type.
         * @member {pb.Resource.Type} type
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.type = 0;

        /**
         * Resource title.
         * @member {string} title
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.title = "";

        /**
         * Resource note.
         * @member {string} note
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.note = "";

        /**
         * Resource url.
         * @member {string} url
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.url = "";

        /**
         * Resource selector.
         * @member {string} selector
         * @memberof pb.Resource
         * @instance
         */
        Resource.prototype.selector = "";

        /**
         * Creates a new Resource instance using the specified properties.
         * @function create
         * @memberof pb.Resource
         * @static
         * @param {pb.IResource=} [properties] Properties to set
         * @returns {pb.Resource} Resource instance
         */
        Resource.create = function create(properties) {
            return new Resource(properties);
        };

        /**
         * Encodes the specified Resource message. Does not implicitly {@link pb.Resource.verify|verify} messages.
         * @function encode
         * @memberof pb.Resource
         * @static
         * @param {pb.IResource} message Resource message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Resource.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
            if (message.title != null && Object.hasOwnProperty.call(message, "title"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.title);
            if (message.note != null && Object.hasOwnProperty.call(message, "note"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.note);
            if (message.url != null && Object.hasOwnProperty.call(message, "url"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.url);
            if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.selector);
            return writer;
        };

        /**
         * Encodes the specified Resource message, length delimited. Does not implicitly {@link pb.Resource.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Resource
         * @static
         * @param {pb.IResource} message Resource message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Resource.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Resource message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Resource
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Resource} Resource
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Resource.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Resource();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.type = reader.int32();
                    break;
                case 3:
                    message.title = reader.string();
                    break;
                case 4:
                    message.note = reader.string();
                    break;
                case 5:
                    message.url = reader.string();
                    break;
                case 6:
                    message.selector = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Resource message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Resource
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Resource} Resource
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Resource.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Resource message.
         * @function verify
         * @memberof pb.Resource
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Resource.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.title != null && message.hasOwnProperty("title"))
                if (!$util.isString(message.title))
                    return "title: string expected";
            if (message.note != null && message.hasOwnProperty("note"))
                if (!$util.isString(message.note))
                    return "note: string expected";
            if (message.url != null && message.hasOwnProperty("url"))
                if (!$util.isString(message.url))
                    return "url: string expected";
            if (message.selector != null && message.hasOwnProperty("selector"))
                if (!$util.isString(message.selector))
                    return "selector: string expected";
            return null;
        };

        /**
         * Creates a Resource message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Resource
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Resource} Resource
         */
        Resource.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Resource)
                return object;
            var message = new $root.pb.Resource();
            if (object.id != null)
                message.id = object.id | 0;
            switch (object.type) {
            case "IMAGES":
            case 0:
                message.type = 0;
                break;
            case "WEB":
            case 1:
                message.type = 1;
                break;
            case "VIDEO":
            case 2:
                message.type = 2;
                break;
            case "ADUIO":
            case 3:
                message.type = 3;
                break;
            }
            if (object.title != null)
                message.title = String(object.title);
            if (object.note != null)
                message.note = String(object.note);
            if (object.url != null)
                message.url = String(object.url);
            if (object.selector != null)
                message.selector = String(object.selector);
            return message;
        };

        /**
         * Creates a plain object from a Resource message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Resource
         * @static
         * @param {pb.Resource} message Resource
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Resource.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.id = 0;
                object.type = options.enums === String ? "IMAGES" : 0;
                object.title = "";
                object.note = "";
                object.url = "";
                object.selector = "";
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.pb.Resource.Type[message.type] : message.type;
            if (message.title != null && message.hasOwnProperty("title"))
                object.title = message.title;
            if (message.note != null && message.hasOwnProperty("note"))
                object.note = message.note;
            if (message.url != null && message.hasOwnProperty("url"))
                object.url = message.url;
            if (message.selector != null && message.hasOwnProperty("selector"))
                object.selector = message.selector;
            return object;
        };

        /**
         * Converts this Resource to JSON.
         * @function toJSON
         * @memberof pb.Resource
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Resource.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Type enum.
         * @name pb.Resource.Type
         * @enum {number}
         * @property {number} IMAGES=0 IMAGES value
         * @property {number} WEB=1 WEB value
         * @property {number} VIDEO=2 VIDEO value
         * @property {number} ADUIO=3 ADUIO value
         */
        Resource.Type = (function() {
            var valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "IMAGES"] = 0;
            values[valuesById[1] = "WEB"] = 1;
            values[valuesById[2] = "VIDEO"] = 2;
            values[valuesById[3] = "ADUIO"] = 3;
            return values;
        })();

        return Resource;
    })();

    pb.Web = (function() {

        /**
         * Properties of a Web.
         * @memberof pb
         * @interface IWeb
         * @property {number|null} [id] Web id
         * @property {string|null} [url] Web url
         * @property {string|null} [selector] Web selector
         * @property {number|null} [time] Web time
         * @property {Uint8Array|null} [image] Web image
         * @property {number|null} [width] Web width
         * @property {number|null} [height] Web height
         */

        /**
         * Constructs a new Web.
         * @memberof pb
         * @classdesc Represents a Web.
         * @implements IWeb
         * @constructor
         * @param {pb.IWeb=} [properties] Properties to set
         */
        function Web(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Web id.
         * @member {number} id
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.id = 0;

        /**
         * Web url.
         * @member {string} url
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.url = "";

        /**
         * Web selector.
         * @member {string} selector
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.selector = "";

        /**
         * Web time.
         * @member {number} time
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.time = 0;

        /**
         * Web image.
         * @member {Uint8Array} image
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.image = $util.newBuffer([]);

        /**
         * Web width.
         * @member {number} width
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.width = 0;

        /**
         * Web height.
         * @member {number} height
         * @memberof pb.Web
         * @instance
         */
        Web.prototype.height = 0;

        /**
         * Creates a new Web instance using the specified properties.
         * @function create
         * @memberof pb.Web
         * @static
         * @param {pb.IWeb=} [properties] Properties to set
         * @returns {pb.Web} Web instance
         */
        Web.create = function create(properties) {
            return new Web(properties);
        };

        /**
         * Encodes the specified Web message. Does not implicitly {@link pb.Web.verify|verify} messages.
         * @function encode
         * @memberof pb.Web
         * @static
         * @param {pb.IWeb} message Web message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Web.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.id);
            if (message.url != null && Object.hasOwnProperty.call(message, "url"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.url);
            if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.selector);
            if (message.time != null && Object.hasOwnProperty.call(message, "time"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.time);
            if (message.image != null && Object.hasOwnProperty.call(message, "image"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.image);
            if (message.width != null && Object.hasOwnProperty.call(message, "width"))
                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.width);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.height);
            return writer;
        };

        /**
         * Encodes the specified Web message, length delimited. Does not implicitly {@link pb.Web.verify|verify} messages.
         * @function encodeDelimited
         * @memberof pb.Web
         * @static
         * @param {pb.IWeb} message Web message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Web.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Web message from the specified reader or buffer.
         * @function decode
         * @memberof pb.Web
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {pb.Web} Web
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Web.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pb.Web();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.id = reader.int32();
                    break;
                case 2:
                    message.url = reader.string();
                    break;
                case 3:
                    message.selector = reader.string();
                    break;
                case 4:
                    message.time = reader.int32();
                    break;
                case 5:
                    message.image = reader.bytes();
                    break;
                case 13:
                    message.width = reader.int32();
                    break;
                case 14:
                    message.height = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Web message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof pb.Web
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {pb.Web} Web
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Web.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Web message.
         * @function verify
         * @memberof pb.Web
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Web.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!$util.isInteger(message.id))
                    return "id: integer expected";
            if (message.url != null && message.hasOwnProperty("url"))
                if (!$util.isString(message.url))
                    return "url: string expected";
            if (message.selector != null && message.hasOwnProperty("selector"))
                if (!$util.isString(message.selector))
                    return "selector: string expected";
            if (message.time != null && message.hasOwnProperty("time"))
                if (!$util.isInteger(message.time))
                    return "time: integer expected";
            if (message.image != null && message.hasOwnProperty("image"))
                if (!(message.image && typeof message.image.length === "number" || $util.isString(message.image)))
                    return "image: buffer expected";
            if (message.width != null && message.hasOwnProperty("width"))
                if (!$util.isInteger(message.width))
                    return "width: integer expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            return null;
        };

        /**
         * Creates a Web message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof pb.Web
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {pb.Web} Web
         */
        Web.fromObject = function fromObject(object) {
            if (object instanceof $root.pb.Web)
                return object;
            var message = new $root.pb.Web();
            if (object.id != null)
                message.id = object.id | 0;
            if (object.url != null)
                message.url = String(object.url);
            if (object.selector != null)
                message.selector = String(object.selector);
            if (object.time != null)
                message.time = object.time | 0;
            if (object.image != null)
                if (typeof object.image === "string")
                    $util.base64.decode(object.image, message.image = $util.newBuffer($util.base64.length(object.image)), 0);
                else if (object.image.length)
                    message.image = object.image;
            if (object.width != null)
                message.width = object.width | 0;
            if (object.height != null)
                message.height = object.height | 0;
            return message;
        };

        /**
         * Creates a plain object from a Web message. Also converts values to other types if specified.
         * @function toObject
         * @memberof pb.Web
         * @static
         * @param {pb.Web} message Web
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Web.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.id = 0;
                object.url = "";
                object.selector = "";
                object.time = 0;
                if (options.bytes === String)
                    object.image = "";
                else {
                    object.image = [];
                    if (options.bytes !== Array)
                        object.image = $util.newBuffer(object.image);
                }
                object.width = 0;
                object.height = 0;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = message.id;
            if (message.url != null && message.hasOwnProperty("url"))
                object.url = message.url;
            if (message.selector != null && message.hasOwnProperty("selector"))
                object.selector = message.selector;
            if (message.time != null && message.hasOwnProperty("time"))
                object.time = message.time;
            if (message.image != null && message.hasOwnProperty("image"))
                object.image = options.bytes === String ? $util.base64.encode(message.image, 0, message.image.length) : options.bytes === Array ? Array.prototype.slice.call(message.image) : message.image;
            if (message.width != null && message.hasOwnProperty("width"))
                object.width = message.width;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            return object;
        };

        /**
         * Converts this Web to JSON.
         * @function toJSON
         * @memberof pb.Web
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Web.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return Web;
    })();

    return pb;
})();

module.exports = $root;
